/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.ems.entity;

import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.thinkgem.jeesite.common.config.Global;
import com.thinkgem.jeesite.common.constant.Constant;
import com.thinkgem.jeesite.common.persistence.DataEntity;

/**
 * 班级Entity
 * @author zad
 * @version 2018-01-25
 */
public class EmsCourse extends DataEntity<EmsCourse> {
	
	private static final long serialVersionUID = 1L;
	private String code;		// 班级代码
	private String name;		// 班级名称
	// private String termId;		// 所属学期
	// private String majorId;		// 所属专业
	private String logo;	// 缩略图
	
	private EmsTerm term;	// 所属学期
	private EmsMajor major;	// 所属专业
	
	private Long classHours;		// 学时
	private BigDecimal fee;		// 学费
	private BigDecimal discount;		// 统一折扣
	private String face;		// 招生对象
	private Long num;		// 招生人数
	private Long hasNum;   // 已报人数
	private EmsClassroom classroom;		// 教室
	private Date beginTime;		// 开课时间
	private String classTime;		// 上课时间
	private EmsTeacher teacher;		// 任课教师
	private String type;		// 班级类型
	private String status;		// 是否启用
	
	public EmsCourse() {
		super();
		this.status = Global.YES;
	}

	public EmsCourse(String id){
		super(id);
	}

	@Length(min=1, max=8, message="班级代码长度必须介于 1 和 8 之间")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	@Length(min=1, max=64, message="班级名称长度必须介于 1 和 64 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public EmsTerm getTerm() {
		return term;
	}

	public void setTerm(EmsTerm term) {
		this.term = term;
	}

	public EmsMajor getMajor() {
		return major;
	}

	public void setMajor(EmsMajor major) {
		this.major = major;
	}

	@NotNull(message="学时不能为空")
	public Long getClassHours() {
		return classHours;
	}

	public void setClassHours(Long classHours) {
		this.classHours = classHours;
	}
	
	public BigDecimal getFee() {
		return fee;
	}

	public void setFee(BigDecimal fee) {
		this.fee = fee;
	}

	public BigDecimal getDiscount() {
		return discount;
	}

	public void setDiscount(BigDecimal discount) {
		this.discount = discount;
	}

	@Length(min=0, max=32, message="招生对象长度必须介于 0 和 32 之间")
	public String getFace() {
		return face;
	}

	public void setFace(String face) {
		this.face = face;
	}
	
	public Long getNum() {
		return num;
	}

	public void setNum(Long num) {
		this.num = num;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getBeginTime() {
		return beginTime;
	}

	public void setBeginTime(Date beginTime) {
		this.beginTime = beginTime;
	}
	
	@Length(min=0, max=64, message="上课时间长度必须介于 0 和 64 之间")
	public String getClassTime() {
		return classTime;
	}

	public void setClassTime(String classTime) {
		this.classTime = classTime;
	}
	
	public EmsClassroom getClassroom() {
		return classroom;
	}

	public void setClassroom(EmsClassroom classroom) {
		this.classroom = classroom;
	}

	public EmsTeacher getTeacher() {
		return teacher;
	}

	public void setTeacher(EmsTeacher teacher) {
		this.teacher = teacher;
	}

	@Length(min=0, max=64, message="班级类型长度必须介于 0 和 64 之间")
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
	@Length(min=0, max=2, message="是否启用长度必须介于 0 和 2 之间")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getLogo() {
		return logo;
	}

	public void setLogo(String logo) {
		this.logo = logo;
	}

	public Long getHasNum() {
		return hasNum;
	}

	public void setHasNum(Long hasNum) {
		this.hasNum = hasNum;
	}
	
}